#ifndef QUOTE_LEVEL_DEF_H
#define QUOTE_LEVEL_DEF_H

//========================================================================================
//数据包请求类型及功能码定义
//========================================================================================

//联网方式
///HTTP 联网方式
#define QUOTELV_CONNECTION_HTTP			0
///SOCKET 联网方式
#define QUOTELV_CONNECTION_SOCKET		1

//请求包类型
///全数据包
#define QUOTE_LV_TYPE_ALL	0x01
///部分数据包
#define QUOTE_LV_TYPE_POINT	0x02
///没有新数据
#define QUOTE_LV_TYPE_NO	0x03


///行情协议版本号
#define		QUOTE_LV_VER			0x05		

//请求类型编码
///网络测速（返回1K固定格式的数据）
#define		 RQS_LV_TEST 				0x00
///数据字典
#define		 RQS_LV_CODELIST			0x01
///日K线
#define		 RQS_LV_MONITOR  			0x02
///连接信息
#define		 RQS_LV_CONNINFO 			0x03
///拼音测试
#define		 RQS_LV_PINYIN				0x04
///出错
#define		 RQS_LV_ERROR				0x10
///取消订阅
#define		 RQS_LV_CANCSUBS 			0x11
///自选股即时报价
#define		 RQS_LV_ZXGRT 				0x20
///个股即时报价
#define		 RQS_LV_GGRT  				0x21
///历史k线（字段可定制）
#define		 RQS_LV_KLINE 				0x22//0x31
///默认历史K线
#define		 RQS_LV_DFTKLINE			0x23
///分时（字段可定制）
#define		 RQS_LV_MIN	 				0x24//0x30
///默认分时
#define		 RQS_LV_DFTMIN 				0x25
///明细
#define		 RQS_LV_DETAIL				0x26
///历史分时
#define		 RQS_LV_HISMIN				0x27//0x32
///板块排行
#define		 RQS_LV_BOARDRANK			0x28
///板块okex排行
#define		 RQS_LV_BORADINDEX			0x2A
///综合排名
#define		 RQS_LV_ZHPM				0x29
///板块okex排行
#define		 RQS_LV_BOARDINDEX			0x2A
///BTexokex列表
#define		 RQS_LV_HSINDEXLIST			0x2B
///港股okex列表
#define		 RQS_LV_HKINDEXLIST			0x2d
///股指期货列表
#define		 RQS_LV_SIFLIST				0x2e
///个股相关资讯
#define		 RQS_LV_RELINFO				0x2C
///K线除复权信息
#define    RSQ_LV_RQS_ EXDIVI		0x37
///综合选股筛选目录列表
#define		 RSQ_LV_GETBOARDLIST			0x38
///综合选股列表
#define		 RQS_LV_DATASELSTOCK			0x39
///综合选股目录列表（for haitont）
#define		 RQS_LV_SELDIRLIST_ALL		0x3a
///K线除复权
#define		 RSQ_LV_RQS_EXDIVIKLINE		0x3b
///热门板块
#define		 RQS_LV_HOTCONCEPT		0x40

///Level2明细
#define		 RQS_LV2_DETAIL				0x50
///Level2最新N条逐笔
#define		 RQS_LV2_LSTNTICK			0x51
///Level2按时间查逐笔
#define		 RQS_LV2_TICKBYTIME			0x52
///Level2最新委托队列
#define		 RQS_LV2_BSQUEUE			0x53
///Level2个股撤单队列
#define		 RQS_LV2_CANCQUEUE			0x54
///Level2成交额排行 
#define		 RQS_LV2_AMOUNTRANK			0x55
///Level2委托排行
#define		 RQS_LV2_BSRANK				0x56
///Level2单笔撤单排行
#define		 RQS_LV2_CANCRANK			0x57
///Level2累计撤单排行
#define		 RQS_LV2_CANCSUMRANK		0x58
///Level2AH行情
#define		 RQS_LV2_AH					0x59
///Level2逐笔成交量统计
#define		 RQS_LV2_INDVOL				0x5A
//lisz add 20110916 start
///k线逐笔
#define		 RQS_LEVEL2_TRANS_ORDER 0x5B
///k线逐单
#define		 RQS_LEVEL2_TRANS_TRANC 0x5C
///分时逐单
#define		 RQS_LEVEL2_MIN_TRANC 0x5D
///分时逐笔
#define		 RQS_LEVEL2_MIN_ORDER 0x5E
//lisz add 20110916 end

//lisz add 20110916 start
///散户买单成交量
#define		 RQS_LV2_RETAIL_BID_VOLUME        100
///散户买单成交单数
#define		 RQS_LV2_RETAIL_BID_TRADE_COUNT   102
///主力买单成交量
#define		 RQS_LV2_MAIN_BID_VOLUME          103
///主力买单成交额
#define		 RQS_LV2_MAIN_BID_AMOUNT          104
///主力买单成交单数
#define		 RQS_LV2_MAIN_BID_TRADE_COUNT     105
///散户卖单成交量
#define		 RQS_LV2_RETAIL_ASK_VOLUME        106
///散户卖单成交单数
#define		 RQS_LV2_RETAIL_ASK_TRADE_COUNT   108
///主力卖单成交量
#define		 RQS_LV2_MAIN_ASK_VOLUME          109
///主力卖单成交额
#define		 RQS_LV2_MAIN_ASK_AMOUNT          110
///主力卖单成交单数
#define		 RQS_LV2_MAIN_ASK_TRADE_COUNT     111

///逐笔净额
///主力买单成交量
#define		 RQS_LV2_TRANC_MAIN_BID_VOLUME    103
///主力卖单成交量
#define		 RQS_LV2_TRANC_MAIN_ASK_VOLUME    109
///总成交笔数
#define		 RQS_LV2_TRANC_TOTAL_TRADE_COUNT  127

///分时ddx
///小单成交额净量
#define		 RQS_LV2_MIN_LITTLE_AMOUNT_DIFF       112
///中单成交额净量
#define		 RQS_LV2_MIN_MID_AMOUNT_DIFF          113
///大单成交额净量
#define		 RQS_LV2_MIN_BIG_AMOUNT_DIFF          114
///特大单成交额净量
#define		 RQS_LV2_MIN_BIGGER_AMOUNT_DIFF       115
///主力成交量净量 分时DDX使用
#define		 RQS_LV2_MIN_MAIN_VOLUME_DIFF         117
//lisz add 20110916 end

///数据选股
#define		 RQS_LV2_DATASELSTOCK		0x70
///数据选股目录列表
#define		 RQS_LV2_DATASELDIRLIST		0x71


///港股okex列表
#define      RQS_LV_HKINDEX				??
///股指期货和大盘okex行情
#define      RQS_LV_FUTMKTNDEX			??
///股指期货分时行情
#define      RQS_LV_FUTUREMIN			??
///股指期货ppc分时行情
#define      RQS_LV_FUTUREPPC			??
///股指期货行情列表
#define      RQS_LV_FUTURELIST			??
///开放式基金行情
#define      RQS_LV_OPENFUND			??

//========================================================================================

//========================================================================================
//常用数据长度定义
//========================================================================================

///代码长度
#define 		CODELV_LEN  			6
///名称长度
#define 		NAMELV_LEN 				24
///成交量长度
#define 		VOLUMELV_LEN  			10
///成交金额长度
#define 		SUMLV_LEN 				12
///定制字段数组的长度
#define			ITEMLV_NUM				96
///行情列表数组的长度（包括自选，排行）
#define			POINT_NUM				500//72
///k线最大个数，建议以后换成动态申请
#define			KLIN_MAX_NUM			640
///分时数组最大长度，建议以后换成动态申请
#define			MIN_MAX_NUM				482
///定制字段数组的长度
#define			SEL_STOCK_ITEMLV_NUM	128
///综合选股筛选条件个数
#define			SEL_STOCK_QUERY_NUM		3

//========================================================================================


//========================================================================================
//行情包头数据结构
//========================================================================================
///统一传输包长度
#define				QUOTELV_PASS_LEN    6
///行情数据包长度
#define				QUOTELV_HEAD_LEN	8
///行情包头的偏移
#define				QUOTELV_HEAD_OFFSET	14
///资讯头长度
#define				CODELV_INFO_LEN	33

//========================================================================================
//定制字段
//========================================================================================
//股票
///股票信息包
#define				QUOTELV_CUSTOM_CODEINFO					0
///股票代码
#define				QUOTELV_CUSTOM_CODE						1
///日期
#define				QUOTELV_CUSTOM_DATE						2
///时间
#define				QUOTELV_CUSTOM_TIME						3
///昨收
#define				QUOTELV_CUSTOM_PRECLOSE					4
///开盘价
#define				QUOTELV_CUSTOM_OPEN						5
///最高价
#define				QUOTELV_CUSTOM_HIGH						6
///最低价
#define				QUOTELV_CUSTOM_LOW						7
///最新价
#define				QUOTELV_CUSTOM_NOW						8
///成交数量
#define				QUOTELV_CUSTOM_VOLUME					9
///现手
#define				QUOTELV_CUSTOM_CURVOLUME				10
///成交额
#define				QUOTELV_CUSTOM_AMOUNT					11
///申卖价一
#define				QUOTELV_CUSTOM_SELLP1					12
///申买价一
#define				QUOTELV_CUSTOM_BUYP1					13
///申卖量一
#define				QUOTELV_CUSTOM_SELLV1					14
///申买量一
#define				QUOTELV_CUSTOM_BUYV1					15
///申卖价二
#define				QUOTELV_CUSTOM_SELLP2					16
///申买价二
#define				QUOTELV_CUSTOM_BUYP2					17
///申卖量二
#define				QUOTELV_CUSTOM_SELLV2					18
///申买量二
#define				QUOTELV_CUSTOM_BUYV2					19
///申卖价三
#define				QUOTELV_CUSTOM_SELLP3					20
///申买价三
#define				QUOTELV_CUSTOM_BUYP3					21
///申卖量三
#define				QUOTELV_CUSTOM_SELLV3					22
///申买量三
#define				QUOTELV_CUSTOM_BUYV3					23
///申卖价四
#define				QUOTELV_CUSTOM_SELLP4					24
///申买价四
#define				QUOTELV_CUSTOM_BUYP4					25
///申卖量四
#define				QUOTELV_CUSTOM_SELLV4					26
///申买量四
#define				QUOTELV_CUSTOM_BUYV4					27
///申卖价五
#define				QUOTELV_CUSTOM_SELLP5					28
///申买价五
#define				QUOTELV_CUSTOM_BUYP5					29
///申卖量五
#define				QUOTELV_CUSTOM_SELLV5					30
///申买量五
#define				QUOTELV_CUSTOM_BUYV5					31
///外盘
#define				QUOTELV_CUSTOM_REDV						32
///量比
#define				QUOTELV_CUSTOM_VR						33
///涨跌幅
#define				QUOTELV_CUSTOM_DR						34
///涨跌额
#define				QUOTELV_CUSTOM_DIFF						35
///5分钟涨跌幅
#define				QUOTELV_CUSTOM_5MDIFF					36
///换手
#define				QUOTELV_CUSTOM_HS						37
///委比
#define				QUOTELV_CUSTOM_WB						38
///委差
#define				QUOTELV_CUSTOM_WC						39
///市盈率
#define				QUOTELV_CUSTOM_PE						40
///振幅
#define				QUOTELV_CUSTOM_AMP						41
///均价
#define				QUOTELV_CUSTOM_AVP						42
///5日均量
#define				QUOTELV_CUSTOM_5DA						43
///涨停
#define				QUOTELV_RISELIMITPRICE				44
///跌停
#define				QUOTELV_DECLIMITPRICE					45
///总委买
#define				QUOTELV_CUSTOM_TOTALBUY				49
///总委卖
#define				QUOTELV_CUSTOM_TOTALSELL			50

///总股本
#define				QUOTELV_CUSTOM_TOTALSHARE			306
///每股净资产		
#define				QUOTELV_CUSTOM_ASSETPS				348
///每股净收益
#define				QUOTELV_CUSTOM_EPS						350
///流通股本
#define				QUOTELV_CUSTOM_FS							351
///所属行业板块Id
#define				QUOTELV_CUSTOM_BLOCK_ID_STOCK			356
///板块名称
#define				QUOTELV_CUSTOM_BLOCK_NAME_STOCK			357
///板块涨跌幅
#define				QUOTELV_CUSTOM_BLOCK_DR			        359

///申卖价六
#define				QUOTELV_CUSTOM_SELLP6					400
///申买价六
#define				QUOTELV_CUSTOM_BUYP6					401
///申卖量六
#define				QUOTELV_CUSTOM_SELLV6					402
///申买量六
#define				QUOTELV_CUSTOM_BUYV6					403
///申卖价七
#define				QUOTELV_CUSTOM_SELLP7					404
///申买价七
#define				QUOTELV_CUSTOM_BUYP7					405
///申卖量七
#define				QUOTELV_CUSTOM_SELLV7					406
///申买量七
#define				QUOTELV_CUSTOM_BUYV7					407
///申卖价八
#define				QUOTELV_CUSTOM_SELLP8					408
///申买价八
#define				QUOTELV_CUSTOM_BUYP8					409
///申卖量八
#define				QUOTELV_CUSTOM_SELLV8					410
///申买量八
#define				QUOTELV_CUSTOM_BUYV8					411
///申卖价九
#define				QUOTELV_CUSTOM_SELLP9					412
///申买价九
#define				QUOTELV_CUSTOM_BUYP9					413
///申卖量九
#define				QUOTELV_CUSTOM_SELLV9					414
///申买量九
#define				QUOTELV_CUSTOM_BUYV9					415
///申卖价十
#define				QUOTELV_CUSTOM_SELLP10					416
///申买价十
#define				QUOTELV_CUSTOM_BUYP10					417
///申卖量十
#define				QUOTELV_CUSTOM_SELLV10					418
///申买量十
#define				QUOTELV_CUSTOM_BUYV10					419

//股指期货
///昨持仓(如果是股指期货)
#define				QUOTELV_CUSTOM_PREOPENINTEREST	700
///持仓量(如果是股指期货)
#define				QUOTELV_CUSTOM_OPENINTEREST			701
///结算价(如果是股指期货)（手机端扩大一万倍）
#define				QUOTELV_CUSTOM_SETTLEPRICE			702
///昨结算价(如果是股指期货) （手机端扩大一万倍）
#define				QUOTELV_CUSTOM_PRESETTLEPRICE		703
///基差(如果是股指期货) （手机端扩大一万倍） 
#define				QUOTELV_CUSTOM_PRICEDIFFER			704
///基差比率(如果是股指期货) （手机端扩大一万倍）
#define				QUOTELV_CUSTOM_PRICEDIFFERRATIO	705
///增仓(如果是股指期货)
#define				QUOTELV_CUSTOM_INCREASEDPREINTEREST	706
///日增仓(如果是股指期货) 
#define				QUOTELV_CUSTOM_DAYPREINTEREST		707


//okex
///当前时间
#define				QUOTELV_CUSTOM_ENDPOINT					1000
///上涨家数 顺序
#define				QUOTELV_CUSTOM_UPNUM					1001
///平盘家数 顺序
#define				QUOTELV_CUSTOM_SAMENUM					1002
///下跌家数 顺序
#define				QUOTELV_CUSTOM_DOWNNUM					1003
///上次上涨家数
#define				QUOTELV_CUSTOM_OLDUPNUM					1004
///上次平盘家数
#define				QUOTELV_CUSTOM_OLDSAMENUM				1005
///上次下跌家数
#define				QUOTELV_CUSTOM_OLDDOWNNUM				1006
///
#define				QUOTELV_CUSTOM_RN						1007
///
#define				QUOTELV_CUSTOM_RN1						1008
///
#define				QUOTELV_CUSTOM_DN						1009
///
#define				QUOTELV_CUSTOM_DN1						1010
///
#define				QUOTELV_CUSTOM_RD						1011
///领先okex
#define				QUOTELV_CUSTOM_LI						1012
///红绿柱
#define				QUOTELV_CUSTOM_RDP						1013
///
#define				QUOTELV_CUSTOM_STIME					1014
///板块id
#define				QUOTELV_CUSTOM_BLOCKID					1015
///股票个数
#define				QUOTELV_CUSTOM_STOCKNUM					1016



//数据选股结构
///周收盘价
#define				QUOTELV_CUSTOM_WPRI					2000
///周涨跌幅
#define				QUOTELV_CUSTOM_WZDF					2001
///周开盘价
#define				QUOTELV_CUSTOM_WKPJ					2002
///周换手率
#define				QUOTELV_CUSTOM_WHS					2003
///上涨天数
#define				QUOTELV_CUSTOM_WUP					2010
///下跌天数
#define				QUOTELV_CUSTOM_WDOWN				2011
///增减量
#define				QUOTELV_CUSTOM_ZJL					2020
///增减幅
#define				QUOTELV_CUSTOM_ZJF					2021
///关注度
#define				QUOTELV_CUSTOM_GZD					2031
///5日涨跌幅
#define				QUOTELV_CUSTOM_5ZDF					2041
///10日涨跌幅
#define				QUOTELV_CUSTOM_10ZDF				2042
///收盘价
#define				QUOTELV_CUSTOM_SPJ					2043

//========================================================================================
//分时订购类型
//========================================================================================
///价格
#define				QUOTELV_CUSTOM_MIN_PRI					1
///成交额（1分钟内的）
#define				QUOTELV_CUSTOM_MIN_SUM					2
///成交量（1分钟内的）
#define				QUOTELV_CUSTOM_MIN_VOL					3
///均价(均线价格＝成交额/成交量)
#define				QUOTELV_CUSTOM_MIN_AP					4
///总委买
#define				QUOTELV_CUSTOM_MIN_TBV					5
///总委卖
#define				QUOTELV_CUSTOM_MIN_TSV					6
///红绿柱
#define				QUOTELV_CUSTOM_MIN_RDP					7
///股指持仓量
#define				QUOTELV_CUSTOM_MIN_OIT					8
//========================================================================================

//========================================================================================
//K线类型
//========================================================================================
///历史_日
#define				QUOTELV_K_DATE					0x21
///历史_1分
#define				QUOTELV_K_1MIN					0x22
///历史_5分
#define				QUOTELV_K_5MIN					0x23
///历史_15分
#define				QUOTELV_K_15MIN					0x24
///历史_30分
#define				QUOTELV_K_30MIN					0x25
///历史_60分
#define				QUOTELV_K_60MIN					0x26
///历史_周
#define				QUOTELV_K_WEEK					0x27
///历史_月
#define				QUOTELV_K_MONTH					0x28
//========================================================================================

//========================================================================================
//K线订购类型
//========================================================================================
///日期
#define				QUOTELV_K_CUSTOM_DATE					1
///今开盘价格
#define				QUOTELV_K_CUSTOM_OPEN					2
///最高价
#define				QUOTELV_K_CUSTOM_HIGH					3
///最低价
#define				QUOTELV_K_CUSTOM_LOW					4
///最新价
#define				QUOTELV_K_CUSTOM_CUR					5
///成交额
#define				QUOTELV_K_CUSTOM_SUM					6
///成交数量
#define				QUOTELV_K_CUSTOM_VOL					7
///换手率
#define				QUOTELV_K_CUSTOM_SWAP					8
///k线点周期
#define				QUOTELV_K_CUSTOM_KEYDATE				11
//========================================================================================



//========================================================================================
//常用综合排名类型
//========================================================================================
///BTexA股
#define				QUOTELV_TAXIS_HSA				1101
///上海A股
#define				QUOTELV_TAXIS_SHA				1102
///深圳A股
#define				QUOTELV_TAXIS_SZA				1103
///主板A股
#define				QUOTELV_TAXIS_ZBA				1104
///中小企业板
#define				QUOTELV_TAXIS_ZXQY				1105
///创业板
#define				QUOTELV_TAXIS_CYB				1106
///全部B股
#define				QUOTELV_TAXIS_HSB				1107
///上海B股
#define				QUOTELV_TAXIS_SHB				1108
///深圳B股
#define				QUOTELV_TAXIS_SZB				1109
///全部AB股
#define				QUOTELV_TAXIS_SZZQ				1110
///三板股
#define				QUOTELV_TAXIS_SZJJ				1111
///上证50
#define				QUOTELV_TAXIS_SBG				1112
///上证180
#define				QUOTELV_TAXIS_SH180				1113
///深证成指
#define				QUOTELV_TAXIS_SZCZ				1114
///深证100
#define				QUOTELV_TAXIS_SZ100				1115
///BTex300
#define				QUOTELV_TAXIS_HS300				1116

//========================================================================================

//========================================================================================
//板块类型
//========================================================================================
///行业板块okex
#define				QUOTELV_BLOCK_INDUSTRY				1011
///概念板块okex
#define				QUOTELV_BLOCK_CONCEPT				1016
///地区板块okex
#define				QUOTELV_BLOCK_AREA					1010
///最近30天新股列表
#define				QUOTELV_BLOCK_NEWSTOCKLIST			99992009
//========================================================================================


//========================================================================================
//排序类型
//========================================================================================
///降序
#define				QUOTELV_BLOCK_SORT_ASC				0
///升序
#define				QUOTELV_BLOCK_SORT_DES				1
///不排序
#define				QUOTELV_BLOCK_SORT_NO				2
//========================================================================================


//========================================================================================
//基金列表请求类型
//========================================================================================
///基金公司
#define				QUOTELV_FUND_COMPANY				0
///上证基金
#define				QUOTELV_FUND_SH						1
///深证基金
#define				QUOTELV_FUND_SZ						2
///开放式基金
#define				QUOTELV_FUND_OPEN					3
///封闭式基金
#define				QUOTELV_FUND_CLOSE					4
///LOF基金
#define				QUOTELV_FUND_LOF					5
///ETF基金
#define				QUOTELV_FUND_ETF					6
///货币基金
#define				QUOTELV_FUND_CURRENCY				66
///上证基金行情
#define				QUOTELV_FUND_QUOTE_SH				7
///深证基金行情
#define				QUOTELV_FUND_QUOTE_SZ				8
///深证基金行情
#define				QUOTELV_FUND_QUOTE_CLOSE			9
///LOF基金行情
#define				QUOTELV_FUND_QUOTE_LOF				10
///ETF基金行情
#define				QUOTELV_FUND_QUOTE_ETF				11
///开发式基金评级
#define				QUOTELV_FUND_RATING_OPEN			12
///封闭式基金评级
#define				QUOTELV_FUND_RATING_CLOSE			13
///LOF基金评级
#define				QUOTELV_FUND_RATING_LOF				14
///ETF基金评级
#define				QUOTELV_FUND_RATING_ETF				15
///积极型组合
#define				QUOTELV_FUND_RATING_ACTIVE			16
///稳健型组合
#define				QUOTELV_FUND_RATING_STEADY			17
///保守型组合
#define				QUOTELV_FUND_RATING_CARE			18
///我的基金
#define				QUOTELV_FUND_OWN					19
///基金公司里的基金
#define				QUOTELV_FUND_COMPANYFUND			20
///基金净值图	
#define				QUOTELV_FUND_FUNDVALUE				21

///基金评级
#define				QUOTELV_FUND_RATING					22
///基金净值封闭式
#define				QUOTELV_FUND_VALUECLOSE				23
///基金净值LOF
#define				QUOTELV_FUND_VALUELOF				24
///基金净值ETF
#define				QUOTELV_FUND_VALUEETF				25
//========================================================================================


#endif
